#include "sw_ml.h"

#include "sw_game_state_main.h"
#include "sw_ml_object.h"
#include <map>
#include <string>
#include <fstream>

std::map<char*, sw_ml_object*> sw_ml::parse(char* filename) {

	// get filestring
	// carriage returns are treated as spaces
	std::string filestring = "";
	std::string s;
	std::ifstream openfile(filename);
	if (openfile.is_open()) {
		while (getline(openfile, s)) {
			if (s.at(0)!='#') {
				// if it's not a comment
				filestring += " " + s;
			}
		}
	}
	openfile.close();

	// TODO produce tokens
	std::map<char*, sw_ml_object*> retmap;

	retmap["tile"] = NULL;
	retmap["enemy"] = NULL;

	return retmap;
}